#!/usr/bin/env python
# -*- coding:utf8 -*-
"""
Author : mafei
@Date   : 2019/12/02

"""

from django.conf.urls import url
from django.conf import settings

from .views.docs import get_swagger_view
from .views.user import UserView
from .views.website import WebSiteView
from .views.user_login import UserLoginView
from .views.user_logout import UserLogoutView
from .views.user_register import UserRegisterView
from .views.history import HistoryView
from .views.alert import AlertHistory
from .views.forget_password import ForgetPasswordView
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

schema_view = get_swagger_view(title='mmonitor PVS API')  #

urlpatterns = [
    url(r'^user$', UserView.as_view()),
    url(r'^forget/password$', ForgetPasswordView.as_view()),
    url(r'^user/login', UserLoginView.as_view()),
    url(r'^user/logout', UserLogoutView.as_view()),
    url(r'^user/register', UserRegisterView.as_view()),
    url(r'^website', WebSiteView.as_view()),
    url(r'^site/history', HistoryView.as_view()),
    url(r'^site/alert', AlertHistory.as_view()),

]

if settings.DEBUG:
    urlpatterns += staticfiles_urlpatterns()
    urlpatterns += [url(r'^docs$', schema_view)]
